# 使用uvicorn+fastapi构建HTTP服务

import uvicorn

from fastapi import FastAPI

# 创建FastAPI服务
app = FastAPI()


# 定义异步HTTP接口
@app.get('/')
async def home():
    return {"message": "Hello World"}


if __name__ == '__main__':
    # 启动uvicorn服务,运行fastapi
    uvicorn.run(app, host='0.0.0.0', port=6006, log_level='info', workers=1)
